package com.study.controller;

import com.study.common.Result;
import com.study.common.ResultCode;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author wfw
 * @Date 2020/07/12 16:21
 */
@CrossOrigin
@RestController
public class ErrorController {
    /**
     * 公共错误跳转
     */
    @RequestMapping(value = "autherror")
    public Result autherror(int code){
        return code == 1 ? new Result(ResultCode.UNAUTHENTICATED) : new Result(ResultCode.UNAUTHORISE);
    }
}
